# Import
snippet ir_react import React
	import React from 'react';

snippet irc_react import React and Component
	import React, { Component } from 'react';

snippet irh_react import React hooks
	import { use$1 } from 'react';

snippet ird_react import ReactDOM
	import ReactDOM from 'react-dom';

snippet irp_react import PropTypes
	import PropTypes from 'prop-types';

# Lifecycle Methods
snippet cdm_react componentDidMount
	componentDidMount() {
		${1}
	};

snippet cdup_react componentDidUpdate
	componentDidUpdate(prevProps, prevState) {
		${1}
	};

snippet cwm_react componentWillMount
	componentWillMount() {
		${1}
	};

snippet cwr_react componentWillReceiveProps
	componentWillReceiveProps(nextProps) {
		${1}
	};

snippet cwun_react componentWillUnmount
	componentWillUnmount() {
		${1}
	};

snippet cwu_react componentWillUpdate
	componentWillUpdate(nextProps, nextState) {
		${1}
	};

snippet scu_react shouldComponentUpdate
	shouldComponentUpdate(nextProps, nextState) {
		${1}
	}

# Props
snippet spt_react static propTypes
	static propTypes = {
		${1}: PropTypes.${2}
	};

snippet pt_react propTypes
	${1}.propTypes = {
		${2}: PropTypes.${2}
	};

snippet sdp_react static defaultProps
	static defaultProps = {
		${1}: ${2}	
	};

snippet dp_react defaultProps
	${1}.defaultProps = {
		${2}: ${3}
	};

snippet pp_react props
	props.${1};

snippet tp_react this props
	this.props.${1};

# State
snippet st_react
	state = {
		${1}: ${2},
	};

snippet sst_react
	this.setState({
		${1}: ${2}
	});

snippet tst_react 
	this.state.${1};

# Component
snippet raf_react
	const ${1:ComponentName} = (${2:props}) => {
		${3:state}

		return (
			<>
				${4}
			</>
		);
	};

snippet rcla_react
	class ${1:ClassName} extends Component {
		render() {
			return (
				<>
					${2}
				</>
			);
		}
	}

snippet ercla_react
	export default class ${1:ClassName} extends Component {
		render() {
			return (
				<>
					${2}
				</>
			);
		};
	};

snippet ctor_react
	constructor() {
		super();

		${1:state}
	}

snippet ren_react
	render() {
		return (
			<>
				${2}
			</>
		);
	}

snippet fup_react
	forceUpdate(${1:callback});


# ReactDOM methods
snippet rdr_react ReactDOM.render
	ReactDOM.render(${1}, ${2});

snippet rdh_react ReactDOM.hydrate
	ReactDOM.hydrate(${1:element}, ${2:container}[, ${3:callback}]);

snippet rdcp_react ReactDOM.createPortal
	ReactDOM.createPortal(${1:child}, ${2:container});
